To sort data and gain more experience in the OData Wizard all while creating an employee directory.
Assuming you’ve completed the previous tutorial and have a new employee directory in the works, you might be wondering “well, this is great and all, but aren’t directories supposed to be sorted by last name or something?” And you are exactly right!! Now we need to figure out how to sort using the OData Wizard.
This tutorial is a continuation of the OData - Part 1: Basic Selection tutorial. We will start off with the template as it is at the end of that tutorial, so if you haven’t already, you should check that tutorial out (it won’t take very long)!
As with the previous tutorial, we need to open the SQL Wizard again. Do this by selecting the ForEach tag [forEach Employee: and clicking the Wizard button in the AutoTag ribbon.
First and foremost, we would like to sort the directory by last name. In order to do this, you drag the LastName property under Employees over to the OrderBy box. You can see the results change in the right panel.
If there are two people with the same last name, it makes sense also to sort them then by first name. To do this, drag the FirstName property to the OrderBy box and place it under LastName.
Finally, generate a document and see what you have created. This step should be very familiar to you by now, but if not, please check out the Inserting a Tag tutorial.
You have completed this tutorial. We recommend taking a look at the OData - Part 3: Filtering with Static Values tutorial next!